const { Schema, model } = require('mongoose');

//设置数据集合
const clientSchema = new Schema({
    username: String,
    password: String,
    age:String,
    gender:String,
    avatarImg:String,//用户头像
      // 关联销售员
      salesId:{
        type:Schema.Types.ObjectId,
        ref:'Sales'
    },
    insurancesId: {
        type: Schema.Types.ObjectId,
        ref: 'Insurances',
    },
    // 关联订单
    orderId:{
        type:Schema.Types.ObjectId,
        ref:'Order'
    },
    
}, { versionKey: false });

//设置数据集合的模型
const Clients = model('Clients', clientSchema, 'clients');

//暴露
module.exports.Clients = Clients;